package com.ciquan.server.service.impl;

import com.ciquan.server.bean.UserInfo;
import com.ciquan.server.bean.WorksInfo;
import com.ciquan.server.dao.WorksInfoMapper;
import com.ciquan.server.service.WorksInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by bjliwei2014 on 2015/2/27.
 */
@Service
public class WorksInfoServiceImpl implements WorksInfoService {

    @Resource
    private WorksInfoMapper worksInfoMapper;

    @Override
    public WorksInfo selectById(int id) {
        return worksInfoMapper.selectById(id);
    }

    @Override
    public List<WorksInfo> selectList() {
        return worksInfoMapper.selectList();
    }

    @Override
    public List<WorksInfo> selectByTime(String startTime, String endTime) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("startTime", startTime);
        map.put("endTime", endTime);
        return worksInfoMapper.selectByTime(map);
    }

    @Override
    public List<UserInfo> attentionArtist(int id) {
        return worksInfoMapper.attentionArtist(id);
    }

    @Override
    public List<UserInfo> attentionUser(int id) {
        return worksInfoMapper.attentionUser(id);
    }
}
